1. Field of the Invention
The present invention relates to a method of setting the priority of devices connected to a bus, and an apparatus having a plurality of devices and an arbiter.
2. Description of the Related Art
In a case that a plurality of masters (devices) use common resources (bus, memory), they use these resources by time-sharing. At this time, to which of masters the resource ownership is to be given must be arbitrated according to given rules (resource access priority of masters). Most popular arbitration schemes of those which are conventionally known are:
round robin;
fixed priority; and
weighted priority.
The “round robin” arbitration scheme equally handles all the masters by setting the priority level of a given master which has acquired the resource ownership to a lowest level at the next arbitration. In this case, every time a master acquires the bus ownership, the priority level of the master is changed. A feature of this arbitration scheme lies in that the resource ownership can be equally given to all the masters. However, a master which requires a relatively large bandwidth sometimes cannot assure its bandwidth.
The “fixed priority” arbitration scheme statically determines the priority levels of respective masters in advance, and can set higher priority levels for a master that requires a large bandwidth and a master that requires to guarantee low-latency operations. In case of this arbitration scheme, because higher priority levels are given to masters that requires larger bandwidths, a master with a high priority level can assure a sufficient bandwidth. However, a master set with a low priority level suffers a disadvantage, i.e., a long inaccessible time to the resources.
The “weighted priority” scheme known as means for resolving the demerits of these “round robin” and “fixed priority” schemes gives a bandwidth assignment ratio like “4:3:2:1” to respective masters, and arbitrates to assign the resources at this ratio. In this case, it is expected to assign one resource at a ratio of four times, three times, twice, and once of 10 arbitrations. Various practical control schemes are available, and as the representative control scheme, the following scheme is known.
Every time a master acquires an ownership, the number of times of acquisition of the ownership is counted. When this count value matches a setting value, it is determined that this master has acquired the bandwidth it requested, and the master devolves the bus ownership to another master. More specifically, the master whose count value of the number of times of acquisition has matched the setting value repeats processing for devolving the ownership to another master until the count values of all other masters respectively match setting values. In this way, when the count values of all the masters become equal to the setting values, the count values of the number of times of acquisition of all the masters are cleared. By repeating this processing, the resources are assigned at the set ratio. In this case, in a situation that all the masters constantly issue access requests, assignment with a bandwidth that matches the ratio can be made. However, the count values are often small, and a situation that only a specific master acquires the ownership may occur depending on the way the masters issue the access requests.
For example, Japanese Patent Laid-Open No. 10-289203 describes a bus arbiter which preferentially assigns a bus to a device which is behind a reference. This bus arbiter comprises a reference counter which operates by clocks based on a transfer rate required for each device, and a transfer data counter which measures an actually transferred data size, so as to attain this assignment. The bus arbiter compare the values of these two counters upon bus arbitration.
As the above arbitration scheme, especially, that which enhances the weighted priority scheme, an arbitration scheme which lowers the priority level of a master that has acquired its required bandwidth by counting an actual transfer size with respect to the required bandwidth for each master is proposed. With this scheme, a specific master never monopolizes the resource ownership further beyond the required bandwidth, and arbitration according to the required bandwidths of individual masters can be made. No relative ratio is set unlike in the “weighted priority” scheme, and required values of respective masters can be directly set. If a plurality of masters have not acquired their required bandwidths, the resource ownership is always assigned to a specific master or its assignment is determined by the round robin scheme.
In case of this scheme, in a case where the total of the required bandwidths to the shared resource does not exceed 100%, the required bandwidths of respective masters are satisfied. However, in a case where the total of the required bandwidths to the shared resource exceeds 100% for a predetermined period of time, the resource ownership is unlikely to be assigned to a master to be actually prioritized. If a master to be prioritized can be determined before operation in a case where the total of the required bandwidths exceeds 100%, this scheme suffices. However, if the priority order of masters cannot be set in advance in a case where the total of the required bandwidths exceeds 100%, it is difficult to assign bandwidths to satisfy the required bandwidths of respective masters.